package org.anderground.app.view.dialogs;

import android.content.Context;
import android.content.res.Resources;
import android.view.View;
import android.widget.TabHost;

/**
 * @author Eldar Abusalimov (eldar.abusalimov@gmail.com)
 * 
 */
public class ResourcesView extends View implements TabHost.TabContentFactory {

	private static final String FAVOURITE_KEY = "fav";
	private static final String LOCAL_KEY = "local";
	private static final String DOWNLOAD_KEY = "download";

	private TabHost tabHost;

	/**
	 * @param context
	 */
	public ResourcesView(Context context) {
		super(context);
		tabHost = new TabHost(context);
		Resources res = context.getResources();

		// TODO introduce R.strings
		tabHost.addTab(tabHost.newTabSpec(FAVOURITE_KEY).setIndicator(
				res.getText(0, "Favourite")).setContent(this));
		tabHost.addTab(tabHost.newTabSpec(LOCAL_KEY).setIndicator(
				res.getText(0, "Local")).setContent(this));
		tabHost.addTab(tabHost.newTabSpec(DOWNLOAD_KEY).setIndicator(
				res.getText(0, "Download")).setContent(this));
	}

	public View createTabContent(String tag) {
		if (tag.equals(FAVOURITE_KEY)) {
			return null;

		} else if (tag.equals(LOCAL_KEY)) {
			return null;

		} else if (tag.equals(DOWNLOAD_KEY)) {
			return null;

		} else {
			return null;
		}
	}

}
